<%- @page_title = _('Upload a file') -%>
<h2><%= @page_title %></h2>
<%- form_for( :upload, @upload,
              :url => uploads_path(@project, @teaching, @group),
              :html => {:class => 'form-small',
                        :multipart => true,
                        :onsubmit => "Field.disable('submit-form'); Element.hide('cancel-form');"}) do |f| -%>
  <div class="form"><!--O .form-->
    <label for="upload_file"><%= _('You can upload a file up to %s', number_to_human_size(AppConfig.max_file_size)) %>:</label>
    <%= f.file_field(:file, :class => 'file-field', :size => 15) %>
    <div class="clear"></div><!--OC .clear-->
    <%= error_message_on(:upload, :file) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <label for="upload_title"><%= _('Title') %>:</label>
    <%= f.text_field(:title, :class => 'textfield') %>
    <%= error_message_on(:upload, :title) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <label for="upload_description"><%= _('Description') %>:</label>
    <%= f.text_area(:description) %>
    <%= error_message_on(:upload, :description) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <label for="upload_deadline_id"><%= _('Pick a deadline') %>:</label>
    <%= f.select(:deadline_id, @teaching.deadlines.map {|d| [d.title, d.id]}, :include_blank => true) %>
    <%= error_message_on(:upload, :deadline_id) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <%= f.check_box(:final, :class => 'checkbox') %>
    <label for="upload_final" class="for-checkbox"><%= _("It's the final version") %></label>
    <div class="clear"></div><!--OC .clear-->
    <%= error_message_on(:upload, :final) %>
  </div><!--C .form-->
  <div class="form"><!--O .form-->
    <%= submit_tag(_('Upload File'), :class => 'button', :id => 'submit-form') %>
    <%= link_to(_('&laquo; Back to group'), group_path(@project, @teaching, @group), :id => 'cancel-form') %>
  </div><!--C .form-->
<%- end -%>